/*
 * Computer.cc
 *
 *  Created on: Apr 3, 2012
 *      Author: victor
 */


#include "Camera.h"
#include "Computer.h"
#include "Consumer.h"
#include "World.h"
#include <unistd.h>

using namespace std;

int main() {
	World * world = new World();

	IOCard * card1 = new IOCard();
	IOCard * card2 = new IOCard();
	IOCard * card3 = new IOCard();

	Merger * merger1 = new Merger( card1 );
	Merger * merger2 = new Merger( card2 );
	Merger * merger3 = new Merger( card3 );

	Computer * computer = new Computer( card1, card2, card3 );
	Consumer * consumer = new Consumer( computer );

	Camera * camera0 = new Camera(0, merger1);
	Camera * camera3 = new Camera(3, merger1);
	Camera * camera6 = new Camera(6, merger1);

	Camera * camera1 = new Camera(1, merger2);
	Camera * camera4 = new Camera(4, merger2);
	Camera * camera7 = new Camera(7, merger2);

	Camera * camera2 = new Camera(2, merger3);
	Camera * camera5 = new Camera(5, merger3);
	Camera * camera8 = new Camera(8, merger3);


	world->start();
	merger1->start();
	merger2->start();
	merger3->start();
	camera0->start();
	camera1->start();
	camera2->start();
	camera3->start();
	camera4->start();
	camera5->start();
	camera6->start();
	camera7->start();
	camera8->start();

	computer->start();
	consumer->start();


	for (;;){

	}

	return 0;
}
